/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Entity;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import javax.persistence.Column;
import javax.persistence.DiscriminatorValue;
import javax.persistence.Entity;
import javax.persistence.OneToMany;

@Entity
@DiscriminatorValue("Veterinarian")
public class Veterinarian extends Person { //inheritance of Person
    
    @Column(nullable = false)
    private String FocusOfPractice;
    @Column(nullable = false)
    private String specialities;
    @Column(nullable = false)
    private int salary;
    @Column(nullable = false)
    private String graduatedAt;
    
    @OneToMany(mappedBy="Veterinarian")
    private List<Appointment> appointment= new ArrayList<>();

    public Veterinarian() {
        super();
        this.FocusOfPractice = "NF";
        this.specialities = "NS";
        this.salary = 0;
        this.graduatedAt = "NG";
    }

    
    public Veterinarian(String FocusOfPratice, String specialities, int salary, String graduatedAt, String name, String lastname, String SSN, Date bithdate, String birthplace) {
        super(name, lastname, SSN, bithdate, birthplace);
        this.FocusOfPractice = FocusOfPratice;
        this.specialities = specialities;
        this.salary = salary;
        this.graduatedAt = graduatedAt;
    }

    public void setFocusOfPratice(String FocusOfPratice) {
        this.FocusOfPractice = FocusOfPratice;
    }

    public void setSpecialities(String specialities) {
        this.specialities = specialities;
    }

    public void setSalary(int salary) {
        this.salary = salary;
    }

    public void setGraduatedAt(String graduatedAt) {
        this.graduatedAt = graduatedAt;
    }

    public void setAppointment(List<Appointment> appointment) {
        this.appointment = appointment;
    }
   
    @Override
    public String toString(){
        return "Focus Of Practice: "+this.FocusOfPractice+"     Especilities: "+this.specialities+"     Salary: "+this.salary+"     Year of graduated:"+this.graduatedAt+"\n";
    }

    public void setVeterinarianList(Veterinarian vet) {
        this.FocusOfPractice = vet.FocusOfPractice;
        this.graduatedAt = vet.graduatedAt;
        this.salary = vet.salary;
        this.specialities = vet.specialities;
    }

    }
